public class Die
{
   //Data declaration
   final int MAX = 6;
   private int faceValue;
   //Constructors
   public Die()
   {
      this.faceValue = this.rollDie();
   }
   
   public Die(int faceValue)
   {
      this.faceValue = faceValue;
   }
   
   //Methods
   public void setfaceValue(int faceValue)
   {
      this.faceValue = faceValue;
   }
   
   public int getfaceValue()
   {
      return this.faceValue;
   }
   
   
   public int rollDie()
   {
    int result;
    result = (int) (Math.random()*this.MAX)+1;
    return result;  
   }
   
   public String toString()
   {
      String result;
      result = "face value is : " + this.faceValue;
      
      return result;
   }
}